namespace Agro.Models
{
    using System;
    using SN.Data;


    /// <summary>
    /// 表名：T_Notice 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class T_Notice : Entity
    {

        protected Int32 _Notice_ID;

        protected String _Notice_Title;

        protected String _Notice_CreateUser;

        protected String _Notice_CreateDate;

        protected String _Notice_Content;

        protected String _Notice_AttachmentName;

        protected String _Notice_AttachmentSize;

        protected Byte[] _Notice_AttachmentFile;

        public Int32 Notice_ID
        {
            get
            {
                return this._Notice_ID;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_ID, _Notice_ID, value);
                this._Notice_ID = value;
            }
        }

        public String Notice_Title
        {
            get
            {
                return this._Notice_Title;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_Title, _Notice_Title, value);
                this._Notice_Title = value;
            }
        }

        public String Notice_CreateUser
        {
            get
            {
                return this._Notice_CreateUser;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_CreateUser, _Notice_CreateUser, value);
                this._Notice_CreateUser = value;
            }
        }

        public String Notice_CreateDate
        {
            get
            {
                return this._Notice_CreateDate;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_CreateDate, _Notice_CreateDate, value);
                this._Notice_CreateDate = value;
            }
        }

        public String Notice_Content
        {
            get
            {
                return this._Notice_Content;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_Content, _Notice_Content, value);
                this._Notice_Content = value;
            }
        }

        public String Notice_AttachmentName
        {
            get
            {
                return this._Notice_AttachmentName;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_AttachmentName, _Notice_AttachmentName, value);
                this._Notice_AttachmentName = value;
            }
        }

        public String Notice_AttachmentSize
        {
            get
            {
                return this._Notice_AttachmentSize;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_AttachmentSize, _Notice_AttachmentSize, value);
                this._Notice_AttachmentSize = value;
            }
        }

        public Byte[] Notice_AttachmentFile
        {
            get
            {
                return this._Notice_AttachmentFile;
            }
            set
            {
                this.OnPropertyValueChange(_.Notice_AttachmentFile, _Notice_AttachmentFile, value);
                this._Notice_AttachmentFile = value;
            }
        }

        /// <summary>
        /// 获取实体中的主键列
        /// </summary>
        protected override Field[] GetPrimaryKeyFields()
        {
            return new Field[] {
                        _.Notice_ID};
        }
        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<T_Notice>("T_Notice");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.Notice_ID;
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.Notice_ID,
                        _.Notice_Title,
                        _.Notice_CreateUser,
                        _.Notice_CreateDate,
                        _.Notice_Content,
                        _.Notice_AttachmentName,
                        _.Notice_AttachmentSize,
                        _.Notice_AttachmentFile};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._Notice_ID,
                        this._Notice_Title,
                        this._Notice_CreateUser,
                        this._Notice_CreateDate,
                        this._Notice_Content,
                        this._Notice_AttachmentName,
                        this._Notice_AttachmentSize,
                        this._Notice_AttachmentFile};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.Notice_ID)))
            {
                this._Notice_ID = reader.GetInt32(_.Notice_ID);
            }
            if ((false == reader.IsDBNull(_.Notice_Title)))
            {
                this._Notice_Title = reader.GetString(_.Notice_Title);
            }
            if ((false == reader.IsDBNull(_.Notice_CreateUser)))
            {
                this._Notice_CreateUser = reader.GetString(_.Notice_CreateUser);
            }
            if ((false == reader.IsDBNull(_.Notice_CreateDate)))
            {
                this._Notice_CreateDate = reader.GetString(_.Notice_CreateDate);
            }
            if ((false == reader.IsDBNull(_.Notice_Content)))
            {
                this._Notice_Content = reader.GetString(_.Notice_Content);
            }
            if ((false == reader.IsDBNull(_.Notice_AttachmentName)))
            {
                this._Notice_AttachmentName = reader.GetString(_.Notice_AttachmentName);
            }
            if ((false == reader.IsDBNull(_.Notice_AttachmentSize)))
            {
                this._Notice_AttachmentSize = reader.GetString(_.Notice_AttachmentSize);
            }
            if ((false == reader.IsDBNull(_.Notice_AttachmentFile)))
            {
                this._Notice_AttachmentFile = reader.GetBytes(_.Notice_AttachmentFile);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(T_Notice).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<T_Notice>();

            /// <summary>
            /// 字段名：Notice_ID - 数据类型：Int32
            /// </summary>
            public static Field Notice_ID = new Field<T_Notice>("Notice_ID");

            /// <summary>
            /// 字段名：Notice_Title - 数据类型：String
            /// </summary>
            public static Field Notice_Title = new Field<T_Notice>("Notice_Title");

            /// <summary>
            /// 字段名：Notice_CreateUser - 数据类型：String
            /// </summary>
            public static Field Notice_CreateUser = new Field<T_Notice>("Notice_CreateUser");

            /// <summary>
            /// 字段名：Notice_CreateDate - 数据类型：String
            /// </summary>
            public static Field Notice_CreateDate = new Field<T_Notice>("Notice_CreateDate");

            /// <summary>
            /// 字段名：Notice_Content - 数据类型：String
            /// </summary>
            public static Field Notice_Content = new Field<T_Notice>("Notice_Content");

            /// <summary>
            /// 字段名：Notice_AttachmentName - 数据类型：String
            /// </summary>
            public static Field Notice_AttachmentName = new Field<T_Notice>("Notice_AttachmentName");

            /// <summary>
            /// 字段名：Notice_AttachmentSize - 数据类型：String
            /// </summary>
            public static Field Notice_AttachmentSize = new Field<T_Notice>("Notice_AttachmentSize");

            /// <summary>
            /// 字段名：Notice_AttachmentFile - 数据类型：Byte[]
            /// </summary>
            public static Field Notice_AttachmentFile = new Field<T_Notice>("Notice_AttachmentFile");
        }
    }
}
